using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Silvery
{
    public partial class SpiritDataTemplate : UserControl
    {
        public SpiritDataTemplate()
        {
            InitializeComponent();
        }
        public void AddFrame(string animatname, ImageSource imagesource)
        {
            AddFrame(animatname, new Image() { Source = imagesource });
        }
        public void AddFrame(string animatname, Image Image)
        {
            var t = this.FindName(animatname) as Panel;
            if (t != null)
            {
                t.Children.Add(Image);
            }
            else
            {
                t = new Canvas();
                LayoutRoot.Children.Add(t);
                t.Children.Add(Image);
            }
        }
    }
}
